import React from 'react';

import { Divider } from '@/shared/ui/Divider';
import { Title } from '@/shared/ui/Title';
import cn from 'classnames';

import cs from './Purchase.module.scss';

type Props = {
  date: any;
  time: any;
  price: number;
  type: any;
  isLast?: boolean;
  isFirst?: boolean;
};

export const Purchase = ({ date, time, isFirst, price, type, isLast }: Props) => (
  <>
    <div className={cn(cs.block, isFirst && cs.isFirst)}>
      <div className={cs.first_block}>
        <Title size="m-no-bold">{date}</Title>
        <span className={cs.typeTime}>{time}</span>
      </div>
      <div className={cs.second_block}>
        <Title className={cs.price}>-{price} ₽</Title>
        <span className={cs.typeTime}>{type}</span>
      </div>
    </div>
    {!isLast && <Divider color="#F3F3F3" />}
  </>
);
